package ua.kpi.javatraining.university;

/**
 * Class for teachers of university.
 * Extends Person class with specific information about professor,
 * his degree and payment.
 *
 * @author Vasily Yatsenko
 */
public class Professor extends Person implements Payable {
    private String degree;
    private double fee;

    public Professor(Name name, Origin origin, Contacts contacts) {
        super(contacts, origin, name);
        degree = null;
        fee = 0;
    }


    public void setDegree(String degree) {
        this.degree = degree;
    }

    public String getDegree() {
        return degree;
    }

    @Override
    public void setFee(double fee) {
        this.fee = fee;
    }

    @Override
    public double getFee() {
        return fee;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();

        builder.append(super.toString());
        builder.append("Fee: ");
        builder.append(getFee());
        builder.append(". Degree: ");
        builder.append(getDegree());
        builder.append(".");
        return builder.toString();
    }
}
